'''Projects'''

from bcapi import BCAPI
from bcuser import get_current_user_account 

def content(handler):
    account = get_current_user_account()

    buffer = ''
    if account != None:
        bc = BCAPI(account)

        projects = bc.projects()

        for project in projects:
            buffer += project.find('id').text + ':' + project.find('name').text + ' : ' + project.find('status').text + '<br />'

    else:
        buffer = 'ERROR'

    return buffer

def css(handler):
    return ''
